export const detailOption = {
  submitBtn: false,
  emptyBtn: false,
  labelWidth: '150',
  span: 6,
  group: [
    {
      icon: 'el-icon-vertical-bar',
      label: '基础信息',
      prop: 'group',
      collapse: true,
      arrow: false,
      column: [
        {
          label: '工单号',
          prop: 'workOrderNo',
          disabled: true
        },
        {
          label: '工单计划数量',
          prop: 'workOrderPlanQuantity',
          disabled: true
        },
        {
          label: '工单完工数量',
          prop: 'workOrderCompletedQuantity',
          disabled: true
        },
        {
          label: '工单不良数',
          prop: 'workOrderNgQuantity',
          disabled: true
        },
        {
          label: '产品序列号',
          prop: 'productSn',
          disabled: true
        },
        {
          label: '产品编码',
          prop: 'productPartNo',
          disabled: true
        },
        {
          label: '产品型号',
          prop: 'productPartModel',
          disabled: true
        },
        {
          label: '当前状态',
          prop: 'currentStatus',
          type: 'select',
          disabled: true,
          dicData: [
            { label: '已报废', value: 'SCRAP' },
            { label: '维修完成', value: 'FINISHED' },
            { label: '待出维修', value: 'WAIT_OUT' },
            { label: '待维修', value: 'WAIT_REPAIR' }
          ]
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '不良信息',
      prop: 'group',
      collapse: true,
      arrow: false,
      column: [
        {
          label: '不良现象',
          prop: 'badPhenomenonName',
          disabled: true
        },
        {
          label: '登记产线',
          prop: 'lineName',
          disabled: true
        },
        {
          label: '登记工序',
          prop: 'routeName',
          disabled: true
        },
        {
          label: '登记工位',
          prop: 'stationName',
          disabled: true
        },
        {
          label: '登记人员',
          prop: 'registerUserName',
          disabled: true
        },
        {
          label: '登记时间',
          prop: 'registerTime',
          disabled: true
        },
        {
          label: '判定人员',
          prop: 'confirmUserName',
          disabled: true
        },
        {
          label: '判定时间',
          prop: 'confirmTime',
          disabled: true
        },
        {
          label: '登记说明',
          prop: 'registerDescription',
          span: 12,
          disabled: true
        },

        {
          label: '判定说明',
          prop: 'confirmDescription',
          span: 12,
          disabled: true
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '维修信息',
      collapse: true,
      arrow: false,
      prop: 'group',
      column: [
        {
          label: '原因大类',
          prop: 'mainBadCauseName',
          disabled: true
        },
        {
          label: '原因小类',
          prop: 'subBadCauseName',
          disabled: true
        },
        {
          label: '原因说明',
          prop: 'badCauseDescription',
          span: 12,
          disabled: true
        },
        {
          label: '维修结果',
          prop: 'repairResult',
          disabled: true,
          type: 'select',
          dicData: [
            { label: '维修完成', value: 'REPAIR_FINISHED' },
            { label: '标记报废', value: 'MARK_SCRAP' }
          ]
        },
        {
          label: '维修说明',
          prop: 'repairDescription',
          span: 12,
          disabled: true,
          control: (val, form) => {
            if (form.currentStatus === 'SCRAP') {
              return {
                repairDescription: {
                  label: '报废说明'
                }
              };
            } else {
              return {
                repairDescription: {
                  label: '维修说明'
                }
              };
            }
          }
        },
        {
          label: '维修人员',
          prop: 'repairUserName',
          disabled: true
        },
        {
          label: '维修时间',
          prop: 'repairTime',
          disabled: true
        },
        {
          label: '已维修次数',
          prop: 'repairTimes',
          disabled: true
        }
      ]
    },
    {
      icon: '',
      label: '',
      labelWidth: 0,
      prop: 'group',
      column: [
        {
          label: '',
          prop: 'table1',
          labelWidth: 0,
          span: 24,
          slot: true
        },
        {
          label: '',
          prop: 'attachments',
          labelWidth: 0,
          span: 24,
          slot: true,
          control: (val, form) => {
            if (form.currentStatus === 'SCRAP') {
              return {
                attachments: {
                  display: false
                }
              };
            } else {
              return {
                attachments: {
                  display: true
                }
              };
            }
          }
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '出维修信息',
      prop: 'group',
      collapse: true,
      arrow: false,
      column: [
        {
          label: '出维修结果',
          prop: 'repairOutResult',
          disabled: true,
          type: 'select',
          dicData: [
            { label: '出维修', value: 'REPAIR_OUT' },
            { label: '返回重修', value: 'REPAIR_REPEAT' },
            { label: '报废', value: 'REPAIR_SCRAP' }
          ]
        },
        {
          label: '指定返回工站',
          prop: 'returnRouteName',
          disabled: true
        },
        {
          label: '出维修说明',
          prop: 'repairOutDescription',
          disabled: true
        },
        {
          label: '出维修人员',
          prop: 'repairOutUserName',
          disabled: true
        },
        {
          label: '出维修时间',
          prop: 'repairOutTime',
          disabled: true
        }
      ]
    }
  ]
};
//子件换料
export const table1Option = {
  columnBtn: false,
  refreshBtn: false,
  addBtn: false,
  editBtn: false,
  menu: false,
  labelWidth: 130,
  menuWidth: 100,
  maxHeight: 300,
  border: true,
  column: [
    {
      label: '维修位号',
      prop: 'locationCode',
      span: 24
    },
    {
      label: '旧子件序列号',
      prop: 'oldSn'
    },
    {
      label: '新子件序列号',
      prop: 'newSn'
    },
    {
      label: '产品编码',
      prop: 'newPartNo'
    },
    {
      label: '产品名称',
      prop: 'newPartName'
    },
    {
      label: '产品型号',
      prop: 'newPartModel'
    },
    {
      label: '维修用量',
      prop: 'quantity',
      span: 24
    }
  ]
};

//原材料换料
export const tableOption = {
  columnBtn: false,
  refreshBtn: false,
  addBtn: false,
  editBtn: false,
  menu: false,
  labelWidth: 130,
  menuWidth: 100,
  maxHeight: 300,
  border: true,
  column: [
    {
      label: '维修位号',
      prop: 'locationCode',
      span: 24
    },
    {
      label: '录入类型',
      prop: 'inputType',
      type: 'select',
      // 无条码：NONE_PACKING_SN；  有条码：HAVE_PACKING_SN
      dicData: [
        { label: '无条码', value: 'NONE_PACKING_SN' },
        { label: '有条码', value: 'HAVE_PACKING_SN' }
      ]
    },
    {
      label: '物料包装条码',
      prop: 'newSn'
    },
    {
      label: '物料编码',
      prop: 'newPartNo'
    },
    {
      label: '物料名称',
      prop: 'newPartNo'
    },
    {
      label: '物料型号',
      prop: 'newPartModel'
    },
    {
      label: '物料品牌',
      prop: 'newPartBrand'
    },
    {
      label: '内部批次',
      prop: 'newLotNo'
    },
    {
      label: '维修用量',
      prop: 'quantity',
      span: 24
    }
  ]
};
//维修位号原物料信息
export const table2Option = {
  columnBtn: false,
  refreshBtn: false,
  addBtn: false,
  editBtn: false,
  menu: false,
  labelWidth: 130,
  menuWidth: 100,
  maxHeight: 300,
  border: true,
  column: [
    {
      label: '维修位号',
      prop: 'locationCode',
      span: 24
    },
    {
      label: '物料包装条码',
      prop: 'newSn'
    },
    {
      label: '物料编码',
      prop: 'newPartNo'
    },
    {
      label: '物料名称',
      prop: 'newPartNo'
    },
    {
      label: '物料型号',
      prop: 'newPartNo'
    },
    {
      label: '物料品牌',
      prop: 'newPartBrand'
    },
    {
      label: '内部批次',
      prop: 'newLotNo',
      span: 24
    }
  ]
};

export const exportOption = {
  calcHeight: 30,
  height: 'calc(100vh - 420px)',
  tip: false,
  searchLabelWidth: 120,
  searchShow: true,
  searchMenuSpan: 10,
  searchMenuPosition: 'right',
  border: true,
  index: true,
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  addBtn: false,
  indexLabel: '序号',
  columnBtn: false,
  column: [
    {
      label: '基本信息',
      prop: '1',
      children: [
        {
          label: '工单号',
          prop: 'workOrderNo',
        },
        {
          label: '产品序列号',
          prop: 'productSn',
        },
        {
          label: '产品编码',
          prop: 'productPartNo',
        },
        {
          label: '产品名称',
          prop: 'productPartName'
        },
        {
          label: '产品型号',
          prop: 'productPartModel',
        },
        {
          label: '当前状态',
          prop: 'currentStatus',
          type: 'select',
          dicData: [
            { label: '已报废', value: 'SCRAP' },
            { label: '维修完成', value: 'FINISHED' },
            { label: '待出维修', value: 'WAIT_OUT' },
            { label: '待维修', value: 'WAIT_REPAIR' }
          ]
        },
        {
          label: '更新时间',
          prop: 'updateTime',
          searchSpan: 8,
          searchType: 'datetimerange',
          format: 'yyyy-MM-dd HH:mm:ss',
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
          startPlaceholder: '开始时间',
          endPlaceholder: '结束时间',
        },
        {
          label: '工单计划数量',
          prop: 'workOrderPlanQuantity',
        },
        {
          label: '工单完工数量',
          prop: 'workOrderCompletedQuantity',
        },
        {
          label: '工单不良数',
          prop: 'workOrderNgQuantity',
        },
      ]
    },
    {
      label: '不良信息',
      prop: '2',
      children: [
        {
          label: '不良现象',
          prop: 'badPhenomenonName',
        },
        {
          label: '登记产线',
          prop: 'lineName',
        },
        {
          label: '登记工序',
          prop: 'routeName',
        },
        {
          label: '登记工位',
          prop: 'stationName',
        },
        {
          label: '登记人员',
          prop: 'registerUserName',
        },
        {
          label: '登记时间',
          prop: 'registerTime',
        },
        {
          label: '判定人员',
          prop: 'confirmUserName',
        },
        {
          label: '判定时间',
          prop: 'confirmTime',
        },
        {
          label: '登记说明',
          prop: 'registerDescription',
        },
        {
          label: '判定说明',
          prop: 'confirmDescription',
        }
      ]
    },

  ]
}
